package com.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MySelfRule {
//表示自定义负载均衡
    @Bean
    public IRule myRule(){
        return new RoundRobinRule();//定义为轮询
//      return new  RandomRule();//定义随机
    }
}


